package A01Test;

public class Main {
    public static void main(String [] args) throws InterruptedException {
        Thread1 t1 = new Thread1();
        Thread2 t2 = new Thread2();
        Thread3 t3 = new Thread3();
        Thread4 t4 = new Thread4();
        t1.start();
        t1.join();
        t2.start();
        t2.join();
        t3.start();
        t3.join();
        t4.start();
        t4.join();
        System.out.println(t1.getSum() + t2.getSum() + t3.getSum() + t4.getSum());
    }
}
class Thread1 extends Thread{
    private int sum = 0;
    @Override
    public void run() {
        for (int i = 1; i <= 25; i++){
            sum += i;
        }
    }
    public int getSum(){
        return sum;
    }
}
class Thread2 extends Thread{
    private int sum = 0;
    @Override
    public void run() {
        for (int i = 26; i <= 50; i++){
            sum += i;
        }
    }
    public int getSum(){
        return sum;
    }
}
class Thread3 extends Thread{
    private int sum = 0;
    @Override
    public void run() {
        for (int i = 51; i <= 75; i++){
            sum += i;
        }
    }
    public int getSum(){
        return sum;
    }
}
class Thread4 extends Thread{
    private int sum = 0;
    @Override
    public void run() {
        for (int i = 76; i <= 100; i++){
            sum += i;
        }
    }
    public int getSum(){
        return sum;
    }
}
